package threads;

public class Thread1 {

	public static void main(String[] args) {
		System.out.println("Thread1");
		MyThread myThread = new MyThread(-1);
		for (int i = 0; i < 100; i++) {
			new Thread(myThread).start();
		}
		for (int i = 0; i < 100; i++) {
			new Thread(new MyThread(i)).start();
		}
	}

}

class MyThread implements Runnable {

	private Integer _instance;

	public MyThread(Integer i) {
		_instance = i;
	}

	@Override
	public void run() {
		System.out.println("Thread name=" + Thread.currentThread().getName() + ", Instance " + _instance + " running");

	}

}
